Skip to content

Feature 411: adds newest opportunities and volunteers to dashboard home page#417

Merged
nadavosa merged 3 commits intodevelopfrom
add-most-recent-opportunities-volunteers-dashboard-page
Apr 28, 2026
Merged

Feature 411: adds newest opportunities and volunteers to dashboard home page#417
nadavosa merged 3 commits intodevelopfrom
add-most-recent-opportunities-volunteers-dashboard-page

Conversation

@DarrellRoberts
Copy link
Copy Markdown
Collaborator

Description

Adds newest opportunities and volunteers to dashboard home page (2 of each)

Related Issues

Closes #411

Changes

  • Fetches two of newest opportunities and volunteers on /dashboard page

Screenshots / Demos

image

Checklist

  • WITHIN THE SCOPE OF AN ISSUE; No unnecessary files included
  • Tests added/updated
  • Documentation updated
  • CI passes

Copy link
Copy Markdown
Collaborator

@nadavosa nadavosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three issues that need fixing:

1. Missing return + wrong condition in both new components

NewestOpportunities.tsx line 24 and NewestVolunteers.tsx line 22 — the early-exit block never returns anything:

if (opportunities?.length === 0) {
  <Heading4>{t("dashboard.home.content.loading")}</Heading4>;  // no return!
}

Two problems:

  • Missing return keyword — the message is never rendered
  • length === 0 means data loaded empty, not loading. Use isLoading from the query hook for the loading state, and handle the empty case separately

2. Non-specific React Query keys risk cache collisions

queryKey: ["opportunities"] and queryKey: ["volunteers"] will share the cache with the full list pages if they use the same keys. The dashboard fetches only 2 newest with NEW status — this needs a distinct key, e.g. ["opportunities", "newest"] and ["volunteers", "newest"].

3. DashboardContentContainer height removed in HomeContent.tsx

The previous height: 300px is gone in the new styles.ts. If this is intentional please confirm — if children don't have intrinsic heights the container may collapse.

@DarrellRoberts
Copy link
Copy Markdown
Collaborator Author

thanks @nadavosa! All very good points and well-spotted. As for point 3, I removed the height because the Newest Volunteers are vertically stacked on top of the New Opportunites, so it exceeds the height of 300px and spills into the Footer (and beyond). I added a min-height with a css var of 300px instead. What do you think?

@DarrellRoberts DarrellRoberts self-assigned this Apr 28, 2026
@nadavosa nadavosa merged commit 1037348 into develop Apr 28, 2026
1 check passed
@nadavosa nadavosa deleted the add-most-recent-opportunities-volunteers-dashboard-page branch April 28, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add most recent opportunities and volunteers to dashboard page

2 participants